<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Admin\Controller;

/**
 * 后台用户控制器
 * @author 麦当苗儿 <zuojiazi@vip.qq.com>
 */
class CommentController extends AdminController {

    /**
     * 用户管理首页
     * @author 麦当苗儿 <zuojiazi@vip.qq.com>
     */
    public function index(){
        $id       =   I('ids');// 文章id
		$pid       =   I('pid');
        $map['aid']  =  $id;
		if($pid>0)
		{
           $map['pid']  =  $pid;
		}
        $list = M("comment")->where($map)->select();
   
       
        $this->assign('list', $list);

        $this->display();
    } 
	
	public function del(){
        $id       =   I('ids');// 评论id
	
        $map['id']  =  $id;

         M("comment")->where($map)->delete();
       M("zanlist")->where(array('cid'=>$id))->delete();
	   $this->success('操作成功！');
    } 

}